﻿using Huayou.Common.Database;
using Huayou.Utils;
using HySoft.Cash.BaseClass;
using HySoft.Cash.DB;
using HySoft.Cash.Structure;
using System;
using System.Data;
using System.Web.UI;
using System.Data.SqlClient;
using System.Configuration;

namespace HySoft.Cash.Business
{
    public class TStatementBN : BaseBusiness
    {
        public static string GetStatementStatusText(StatementStatuses status)
        {
            string statusText = string.Empty;
            switch (status)
            {
                case StatementStatuses.Normal:
                    statusText = "Normal";
                    break;
                default:
                    break;
            }
            return statusText;
        }

        private TStatementDB db;

        public TStatementBN(Page page)
            : base(page)
        {
            this.db = null;
            this.db = new TStatementDB(base.curDBOperater);
        }

        public TStatementBN(Page page, DBOperate oper)
            : base(page, oper)
        {
            this.db = null;
            this.db = new TStatementDB(base.curDBOperater);
        }

        public TStatementDT Get(Guid statementGuid)
        {
            TStatementDT tdt = null;
            
                try
                {
                    tdt = this.db.Get(statementGuid);
                }
                catch (Exception exception)
                {
                    throw exception;
                }
            
            
            return tdt;
        }

        public DataTable GetList()
        {
            base.DBFieldList = TStatementDT.allFields;
            base.DBTable = "tStatementMaster";
            return base.CommonGetList();
        }
    }
}
